<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <base href="<%=basePath%>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>新闻中国</title>
    <link href="../../../static/css/read.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="../../../static/js/jquery-1.12.4.min.js"></script>
    <script>

    </script>
</head>
<body>
<div class="main">
    <div class="content" style="min-width: 100%;">
        <input type="button" onclick="toIndex()" value="返回首页"/>
        <div style="margin: 0px auto; width: 80%">
            <table>
                <tr>
                    <td colspan="2" align="center">${sessionScope.detailNews.ntitle}</td>
                </tr>
                <tr>
                    <td colspan="2">
                        <hr/>
                    </td>
                </tr>
                <tr>
                    <td align="center">作者：${sessionScope.detailNews.nauthor}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </td>
                    <td align="left">发布时间：${sessionScope.detailNews.ncreatedate}</td>
                </tr>
                <tr>
                    <td colspan="2" align="center"></td>
                </tr>
                <tr>
                    <td colspan="2">${sessionScope.detailNews.ncontent}
                    </td>
                </tr>
<%--                <img src="../../../static/images/e9e093ba-4d04-4140-8a36-eb519200f5d0aaa.png">--%>
<%--                <img src="../../../${sessionScope.detailNews.npicpath}" width="249" alt="图片">--%>
                <c:if test="${not empty sessionScope.detailNews.npicpath}">
                    <tr>
                        <img src="../../../${sessionScope.detailNews.npicpath}" width="249" alt="图片">
                    </tr>
                </c:if>
                <tr>
                    <td colspan="2">
                        <hr/>
                    </td>
                </tr>
            </table>
            <div id="mycomment" style="width: 100%">
            </div>


            <form action="" method="post">
                <input type="hidden" id="nid" name="nid" value="${sessionScope.detailNews.nid}"/>
                <table width="100%">
                    <tr>
                        <td>评 论</td>
                    </tr>
                    <tr>
                        <td>用户名：</td>
                        <td><c:choose>
                            <c:when test="${not empty sessionScope.admin}">
                                <input id="cauthor" name="cauthor"
                                       value="${sessionScope.admin.username}" readonly="readonly"
                                       style="border: 0px;"/>
                            </c:when>
                            <c:otherwise>
                                <input id="cauthor" name="cauthor" value="这家伙很懒什么也没留下"/>
                            </c:otherwise>
                        </c:choose> IP： <input name="cip" id="cip"
                                               value="${pageContext.request.remoteAddr}" readonly="readonly"
                                               style="border: 0px;"/></td>
                    </tr>
                    <tr>
                        <td colspan="2"><textarea style="width: 100%;padding-left: 3px"
                                                  name="ccontent" id="ccontent" rows="10"></textarea></td>
                    </tr>
                    <tr>
                        <td><input id="commentSubmit" name="submit" value="发  表"
                                   type="button" onclick="publicComment()"/>
                            <!-- <input name="submit" value="发  表" type="submit"/> -->
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
</body>
</html>
